<template>
  <div id="app">
    <div id="container" class="map01">
      <img src="#" />
    </div>
    <div class="footer">
      <dl class="map02">
        <dt>
          <h2>建湖县卫生健康委员会</h2>
          <h3>地址：盐城市建湖县人民南路908号</h3>
        </dt>
        <dd>
          <a id="go">
            <img src="@/assets/images/dh.png" alt />
            去这里
          </a>
        </dd>
      </dl>
    </div>
  </div>
</template>

<script>
import * as $ from "@/utils/jquery.min.js";
import "@/utils/maps.js";


export default {
  name: "App",
  mounted() {
    const map = new AMap.Map("container", {
      zoom: 18,
      center: [119.791082,33.437247],
      enableHighAccuracy: true, // 是否使用高精度定位，默认:true
      timeout: 10000, // 超过10秒后停止定位，默认：5s
      buttonPosition: "RB", // 定位按钮的停靠位置
      buttonOffset: new AMap.Pixel(10, 20), // 定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
      zoomToAccuracy: true // 定位成功后是否自动调整地图视野到定位点
    });

    const marker1 = new AMap.Marker({
      map: map,
      position: [119.791082,33.437247]
    });
    marker1.on("click", function(e) {
      marker1.markOnAMAP({
        name: "建湖县卫生健康委员会",
        position: map.getCurrentPosition
      });
    });

    $("#go").on("click", function(e) {
      marker1.markOnAMAP({
        name: "建湖县卫生健康委员会",
        position: map.getCurrentPosition
      });
    });
  }
};
</script>
<style scoped>
@import "../../assets/health-commission/css/base.css";
@import "../../assets/health-commission/css/other.css";
</style>

